package com.epam.training.concurrency.second.task2;

import java.util.LinkedList;
import java.util.Queue;

class TestCilcularBuffer {
	private static final int WRITER_COUNT = 10;
	private static final int READER_COUNT = 6;

	public static void main(String args[]) {
		new TestCilcularBuffer();
	}

	private TestCilcularBuffer() {
		CircularBuffer buffer = new CircularBuffer(5);
		Queue<Writer> listWr = new LinkedList<Writer>();
		Queue<Reader> listR = new LinkedList<Reader>();
		Writer w;
		for (int i = 0; i < WRITER_COUNT; i++) {
			w = new Writer(buffer);
			w.start();
			listWr.add(w);
		}

		Reader r;
		for (int i = 0; i < READER_COUNT; i++) {
			r = new Reader(buffer);
			r.start();
			listR.add(r);
		}
	}
}
